﻿
@echo off

set exepath=%~dp0

for /f "tokens=*" %%i in ('findstr "<ServiceName>.*</ServiceName>" %exepath%ServiceSetting.xml')do set "s=%%i"

for /f "delims=<" %%j in ("%s:*<ServiceName>=%")do set "ServiceName=%%j"

rem set "ServiceName=%ServiceName:''="%"

echo --------------------The service name is :%ServiceName%--------------------------

C:\Windows\System32\net.exe stop %ServiceName%

C:\Windows\System32\sc.exe delete %ServiceName%

pause